package org.supreme.fegin;


import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;
import org.supreme.domain.User;
import org.supreme.service.PayService;
@Component
public class HystrixClientFallbackFactory implements FallbackFactory<PayService> {

    @Override
    public PayService create(Throwable throwable) {
        return new PayService() {
            @Override
            public User getUserById(Long id) {
                return new User(-1L, "错误警告", "不要急一个一个来");
            }
        };
    }
}
